# Title: Replication files for "The Personal Is Political: Assessing the Effects of Personal Narratives on Public Opinion"

Article Authors: 
Marie Schenk, Paul Testa, and Kristen Essel

Corresponding Author for replication files: 
Paul Testa (paul_testa@brown.edu)

README Author: 
Paul Testa

Journal: 
American Politics Research

Date: 
August 8, 2025

## Contents:

├── README.md                           # This file
├── 01_data/
│   ├── 01_raw/abortion_raw.rda         # Raw data from 2023 Taubman Poll
│   ├── 02_clean/abortion.rda           # Recoded data for analysis
├── 02_code/
│   ├── 00_libraries.R                  # Loads required R packages
│   ├── 01_functions.R                  # Custom functions used in analysis
│   ├── 02_apr_setup_data.R             # R file to set up data
│   ├── 02_apr_setup_data.qmd           # .qmd file to set up data
│   ├── 02_apr_setup_data.pdf           # Rendered output of .qmd
│   ├── 03_apr_replicate_results.R      # R file to replicate results
│   ├── 03_apr_replicate_results.qmd    # .qmd file to replicate results
│   ├── 03_apr_replicate_results.pdf    # Rendered output of .qmd
├── 03_figures/
│   ├── eps/                            # .eps versions of figures
│   ├── pdf/                            # .pdf versions of figures
│   ├── tiff/                           # .tiff versions of figures
├── 04_tables/
│   ├── *.tex                           # LaTeX tables in paper and appendix


Software Requirements
Operating System:

macOS Sequoia 15.5 (replication should work on other platforms with R 4.5.0+)

Software:

R (version 4.5.0)

RStudio (version 2025.5.0.496 or later)

R Packages Required:
tidyverse (2.0.0), DeclareDesign (1.0.10), labelled (2.14.1), car (3.1.3),  Hmisc (5.2.3), easystats (0.7.4), pbapply (1.7.2), vader (0.2.1), tidytext (0.4.2), widyr (0.1.5), knitr (1.50),  ggridges (0.5.6), ggpubr (0.6.0), gtsummary (2.2.0), kableExtra (1.4.0), patchwork (1.3.0), texreg (1.39.4)

Install all packages using:

```{r}
install.packages(c(
  "tidyverse", "DeclareDesign", "labelled", 
  "car", "Hmisc", "easystats", "pbapply", 
  "vader", "tidytext", "widyr", "knitr",
  "ggridges", "ggpubr", "gtsummary", 
  "kableExtra", "patchwork", "texreg",
))
```

Or run the 00_libraries.R script to install and load them.

## Software Requirements

Computing Environment: MacOS Sequoia 15.5

Software: R (Version 4.5.0) R Studio (Version 2025.5.0.496)

Required Libraries: 


## Replication Instructions

To reproduce the results presented in the paper:

1. Download the replication files

2. Open RStudio (recommended) or R, and set your working directory to the 02_code/

3. Install the required packages

4. Run the replication analysis via either:

- the Quarto file: Open and render 02_code/03_apr_replicate_results.qmd

- or the base R script: Set working directory and source 02_code/03_apr_replicate_results.R

This will:

- Load required packages and custom functions

- Import the processed data from 02_setup_data.qmd/.R

- Estimate all models reported in the main text and appendix

- Generate all figures and tables in the 03_figures/ and 04_tables/directories

- Save a PDF of the results (03_apr_replicate_results.pdf)

Notes:

The recoded data from 02_apr_setup_data.qmd/.R is included the 01_data/02_clean/abortion.rda. so you don't need to run these files to replicate the results, but you can if you like.

The replication file takes 5 to 6 hours to run completely, depending on your machine.

If you encounter issues or have questions about the replication materials, feel free to contact Paul Testa at the email above.


## Rendering to pdf

To knit the .qmd replication file to PDF, you need to:

1. Install Quarto (if not already installed)

    - Download and install from: https://quarto.org/docs/get-started/

Or install from R with:

```{r}
install.packages("quarto")
```

2. Install a LaTeX distribution

To render to PDF, you must have LaTeX installed. Recommended options:

macOS: MacTeX (https://www.tug.org/mactex/)

Windows: TinyTeX (recommended for minimal setup)

Linux: Install TeX Live via your package manager

To install TinyTeX from R:

```{r}
install.packages("tinytex")
tinytex::install_tinytex()
```


3. Knit the file

Once Quarto and LaTeX are installed:

Open 02_code/03_apr_replicate_results.qmd in RStudio

Click the Render button at the top of the editor, or run:

```{r}
quarto::quarto_render("02_code/03_apr_replicate_results.qmd", output_format = "pdf")
```

This will produce a PDF copy of the results in the same directory.





